<!--Author: @ngel Sullon Macalupu-->
<? require_once '../../Include.php';
require_once '../../WEB_INF/SubmitConsulting/LiveScrum/ModConfig/Data/UsuarioData.php';
require_once '../../WEB_INF/SubmitConsulting/LiveScrum/ModConfig/Data/Entity/Usuario.php';
require_once('../../WEB_INF/SubmitConsulting/LiveScrum/Common/Data/CryptoString.php');
?>
<html>
<head>
<title>Save</title>
    <link type="text/css" rel="STYLESHEET" href="../../Recurso/Style/App.css">
    <script type="text/javascript" src="../../Recurso/Script/app.util.js" ></script>
    <script type="text/javascript" src="../../Recurso/Script/jquery-1.1.2.js" ></script>
<script type='text/javascript' language='JavaScript'><!--
            function sf(){ document.fm.btn.focus(); }
        // --></script>
</head>
<?
$usuarioId = trim($_POST['usuarioId']) ? trim($_POST['usuarioId']) : '';
//$forward = trim($_POST['forward']) ? trim($_POST['forward']) : '';
$d= new Usuario();
$d->setUsuarioId($usuarioId);

$crypt=new CryptoString();

if( strlen(trim($_POST['clave'])) <3 )
	trigger_error("<p calss=Error>Clave nueva muy corta, debe ser de 3 a mas digitos!", E_USER_ERROR. "</p>");

$tran= new UsuarioData();
$d= $tran->findByPk($usuarioId);//pk solo hay que modificar la clave y si clave es nueva
$d->setClave($crypt->encrypt( trim($_POST['clave']) ? trim($_POST['clave']) : '' ));
$d->setForzarClave("No");
$resp=$tran->update($d).' reg. update in Usuario ';
?>
<body onLoad='sf()'>
	<meta http-equiv='Refresh' content='1; URL=../../Menu/Rol1/Frame.php'>
	<table align='center' class='ItemListTable'>
		<form action='../../Menu/Rol1/Frame.php' name='fm' method='post'>
			<input type='hidden' name='go' value=''>
			<tr>
				<td>Resultado: <?= $resp ?>
				</td>
			</tr>
			<tr>
				<td align='center'><input type='submit' class='Btn' name='btn'
					value='Aceptar'>
				</td>
			</tr>
		</form>
	</table>
</body>
</html>
